<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en_US" xmlns="http://www.w3.org/1999/xhtml" lang="en_US"><head>



  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- deployment.qdoc -->
  <title>Qt 4.7.0: Deploying an Application on the Symbian Platform</title>
  <link rel="stylesheet" type="text/css" href="deployment-symbian_files/style.css">
  <script src="deployment-symbian_files/jquery.js" type="text/javascript"></script>
  <script src="deployment-symbian_files/functions.js" type="text/javascript"></script>
  <script src="deployment-symbian_files/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="deployment-symbian_files/superfish.css">  <script src="deployment-symbian_files/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="deployment-symbian_files/narrow.css">
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head><body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="http://doc.qt.nokia.com/4.7/index.html">Home</a></div>
    <a href="http://doc.qt.nokia.com/4.7/index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.nokia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://developer.qt.nokia.com/">DEV</a></li>
        <li class="nav-topright-labs"><a href="http://labs.qt.nokia.com/blogs/">LABS</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://doc.qt.nokia.com/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.nokia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="http://doc.qt.nokia.com/4.7/index.html">Qt 4.7</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://doc.qt.nokia.com/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu sf-js-enabled sf-shadow" id="narrowmenu"> 
		 <li><a href="#">API Lookup</a> 
			 <ul id="topmenuLook"> 
			   <li><a href="http://doc.qt.nokia.com/4.7/classes.html">Class index</a></li> 
 			  <li><a href="http://doc.qt.nokia.com/4.7/functions.html">Function index</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/modules.html">Modules</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/namespaces.html">Namespaces</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/qtglobal.html">Global Declarations</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/licensing.html">Licenses and Credits</a></li> 
			   </ul> 
		 </li> 
		 <li><a href="#">Qt Topics</a> 
			 <ul id="topmenuTopic"> 
			   <li><a href="http://doc.qt.nokia.com/4.7/qt-basic-concepts.html">Programming with Qt</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/qtquick.html">Device UI's &amp; Qt Quick</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/qt-gui-concepts.html">UI Design with Qt</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/developing-with-qt.html">Cross-platform and Platform-specific</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/platform-specific.html">Platform-specific info</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/technology-apis.html">Qt and Key Technologies</a></li> 
			   <li><a href="http://doc.qt.nokia.com/4.7/best-practices.html">How-To's and Best Practices</a></li> 
			 </ul> 
		</li> 
		 <li><a href="#">Examples</a> 
			 <ul id="topmenuexample"> 
				 <li><a href="http://doc.qt.nokia.com/4.7/all-examples.html">Examples</a></li> 
				 <li><a href="http://doc.qt.nokia.com/4.7/tutorials.html">Tutorials</a></li> 
				 <li><a href="http://doc.qt.nokia.com/4.7/demos.html">Demos</a></li> 
				 <li><a href="http://doc.qt.nokia.com/4.7/qdeclarativeexamples.html">QML Examples</a></li> 
			 </ul> 
		 </li> 
 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input name="searchstring" id="pageType" type="text">
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div id="list001" class="list">
          <ul id="ul001">
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/classes.html">Class index</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/functions.html">Function index</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/modules.html">Modules</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/namespaces.html">Namespaces</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/qtglobal.html">Global Declarations</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002">
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/qt-basic-concepts.html">Programming with Qt</a></li> 
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/qtquick.html">Device UI's &amp; Qt Quick</a></li> 
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/qt-gui-concepts.html">UI Design with Qt</a></li> 
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/developing-with-qt.html">Cross-platform and Platform-specific</a></li> 
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/platform-specific.html">Platform-specific info</a></li> 
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/technology-apis.html">Qt and Key Technologies</a></li> 
			   <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/all-examples.html">Examples</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/tutorials.html">Tutorials</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/demos.html">Demos</a></li>
              <li style="display: block;" class="defaultLink"><a href="http://doc.qt.nokia.com/4.7/qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="http://doc.qt.nokia.com/4.7/index.html">Home</a></li>
              <!--  Bread crumbs goes here -->
              <li>Deploying an Application on the Symbian Platform</li>            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#overview">Overview</a></li>
<li class="level1"><a href="#requirements">Requirements</a></li>
<li class="level1"><a href="#static-linking">Static Linking</a></li>
<li class="level1"><a href="#shared-libraries">Shared Libraries</a></li>
<li class="level2"><a href="#building-qt-as-a-shared-library">Building Qt as a Shared Library</a></li>
<li class="level1"><a href="#shared-libraries">Shared Libraries</a></li>
<li class="level1"><a href="#further-reading">Further Reading</a></li>
</ul>
</div>
<h1 class="title">Deploying an Application on the Symbian Platform</h1>
<span class="subtitle"></span>
<!-- $$$deployment-symbian.html-description -->
<div class="descr"> <a name="details"></a>
<a name="overview"></a>
<h2>Overview</h2>
<p>Applications are deployed to Symbian devices in signed <tt>.sis</tt> package files. The <tt>.sis</tt> file content is controlled with <tt>.pkg</tt> files. The <tt>.pkg</tt> file contains a set of instructions used by tools to produce a <tt>.sis</tt> file. <tt>qmake</tt> generates a default <tt>.pkg</tt> file for your project. The <tt>.pkg</tt> file generated by <tt>qmake</tt>
 is typically fully functional for testing purposes but when planning to
 deliver your application to end-users some changes are needed. This 
document describes what changes are typically needed and how to 
implement them.</p>
<a name="requirements"></a>
<h2>Requirements</h2>
<p>Download the latest release of the Smart Installer from <a href="http://get.qt.nokia.com/nokiasmartinstaller/">http://get.qt.nokia.com/nokiasmartinstaller/</a>, and install it on top of the Qt package.</p>
<a name="static-linking"></a>
<h2>Static Linking</h2>
<p>Qt for the Symbian platform does not currently support static linking
 of Qt libraries with application binaries. You will need to build 
shared libraries as described below and link your application with them.</p>
<a name="shared-libraries"></a>
<h2>Shared Libraries</h2>
<p>When deploying the application using the shared libraries approach we
 must ensure that the Qt runtime is correctly redistributed along with 
the application executable, and also that all Qt dependencies are 
redistributed along with the application.</p>
<p>We will demonstrate these procedures in terms of deploying the <a href="http://doc.qt.nokia.com/4.7/widgets-wiggly.html">Wiggly</a> application that is provided in Qt's examples directory.</p>
<a name="building-qt-as-a-shared-library"></a>
<h3>Building Qt as a Shared Library</h3>
<p>We assume that you already have installed Qt as a shared library, in the <tt>C:\path\to\Qt</tt> directory which is the default when installing Qt for Symbian. For more information on how to build Qt, see the <a href="http://doc.qt.nokia.com/4.7/installation.html">Installation</a> documentation.</p>
<a name="shared-libraries"></a>
<h2>Shared Libraries</h2>
<p>After ensuring that Qt is built as a shared library, we can build the <a href="http://doc.qt.nokia.com/4.7/widgets-wiggly.html">Wiggly</a> application. First, we must go into the directory that contains the application:</p>
<pre class="highlightedCode brush: cpp"> cd examples\widgets\wiggly</pre>
<p>To prepare the application for deployment we must ensure that the <tt>.pkg</tt> file generated by <tt>qmake</tt> contains the relevant vendor information and embeds the necessary dependencies to the application deployment file (<tt>.sis</tt>). The content of the generated <tt>.pkg</tt> file can be controlled with the Symbian specific <tt>qmake</tt> <a href="http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#deployment">DEPLOYMENT</a> keyword extensions.</p>
<p>First, we will change the vendor statement to something more 
meaningful. The application vendor is visible to end-user during the 
installation.</p>
<pre class="highlightedCode brush: cpp"> vendorinfo = \
     "%{\"Example Localized Vendor\"}" \
     ":\"Example Vendor\""

 my_deployment.pkg_prerules = vendorinfo
 DEPLOYMENT += my_deployment</pre>
<p>Second we will tell the Symbian application installer that this application supports only S60 5.0 based devices:</p>
<pre class="highlightedCode brush: cpp"> supported_platforms = \
     "; This demo only supports S60 5.0" \
     "[0x1028315F],0,0,0,{\"S60ProductID\"}"

 default_deployment.pkg_prerules -= pkg_platform_dependencies
 my_deployment.pkg_prerules += supported_platforms
 DEPLOYMENT += my_deployment</pre>
<p>You can find a list of platform and device indentification codes from <a href="http://wiki.forum.nokia.com/index.php/S60_Platform_and_device_identification_codes">Forum Nokia Wiki</a>. By default <tt>.pkg</tt> file generated by <tt>qmake</tt> adds support for all S60 3rd edition FP1, S60 3rd edition FP2 and S60 5th edition devices.</p>
<p>Now we are ready to compile the application and create the application deployment file. Run <tt>qmake</tt> to create Symbian specific makefiles, resources (<tt>.rss</tt>) and deployment packaging files (<tt>.pkg</tt>). And do build to create the application binaries and resources.</p>
<pre class="highlightedCode brush: cpp"> qmake
 make release-gcce</pre>
<p>If everything compiled and linked without any errors, we are now ready to create an application installation package (<tt>wiggly_installer.sis</tt>).</p>
<p>If you haven't done so already, download the latest release of the Smart Installer from <a href="http://get.qt.nokia.com/nokiasmartinstaller/">http://get.qt.nokia.com/nokiasmartinstaller/</a>, and install it on top of the Qt package</p>
<p>Then use this command to create the installer sis package:</p>
<pre class="highlightedCode brush: cpp"> make installer_sis</pre>
<p>If all binaries and dependencies were found, you should now have a self signed <tt>wiggly_installer.sis</tt>
 ready to be installed on a device. The smart installer contained in the
 in the installer package will download the necessary dependencies such 
as Qt libraries to the device.</p>
<p><b>Note:</b> If you want to have your application properly Symbian 
Signed for distribution, you will have to properly sign both the 
application and the application installer packages. Please see <a href="http://developer.symbian.org/wiki/index.php/Category:Symbian_Signed">Symbian Signed wiki</a> for more information about Symbian Signed.</p>
<p>For more information about creating a <tt>.sis</tt> file and installing it to device see also <a href="http://doc.qt.nokia.com/4.7/symbian-with-qt-introduction.html#installing-your-own-applications">here</a>.</p>
<a name="further-reading"></a>
<h2>Further Reading</h2>
<p>This document aims to cover the common case for developers who want 
to deploy Qt applications on devices using the Smart Installer. It does 
not aim to cover every possible way of installing applications, Qt and 
other dependencies on a device.</p>
<p>A wider selection of deployment methods is described in the <a href="http://developer.symbian.org/wiki/index.php/Deploying_a_Qt_Application">Deploying a Qt Application article</a> on the Symbian Foundation Developer Wiki.</p>
</div>
<!-- @@@deployment-symbian.html -->
<p>
</p>
        <div class="feedback t_button">
          [+] Documentation Feedback</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">©</acronym> 2008-2010 Nokia Corporation and/or its
      subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide.</p>
    <p>
      All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://qt.nokia.com/about/privacy-policy">Privacy Policy</a></p>
    <br>
    <p>
      Licensees holding valid Qt Commercial licenses may use this 
document in accordance with the      Qt Commercial License Agreement 
provided with the Software or, alternatively, in accordance      with 
the terms contained in a written agreement between you and Nokia.</p>
    <p>
      Alternatively, this document may be used under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU
      Free Documentation License version 1.3</a>
      as published by the Free Software Foundation.</p>
  </div>
  <div id="feedbackBox">
      <div id="feedcloseX" class="feedclose t_button">X</div>
    <form id="feedform" action="http://doc.qt.nokia.com/docFeedbck/feedback.php" method="get">
      <p id="noteHead">Thank you for giving your feedback.</p> <p class="note">Make sure it is related to this specific page. For more general bugs and 
      requests, please use the <a href="http://bugreports.qt.nokia.com/secure/Dashboard.jspa">Qt Bug Tracker</a>.</p>
      <p><textarea id="feedbox" name="feedText" rows="5" cols="40"></textarea></p>
      <p><input id="feedsubmit" class="feedclose" name="feedback" type="submit"></p>
    <input id="feedUrl" name="feedUrl" value="http://doc.qt.nokia.com/4.7/deployment-symbian.html" style="display: none;"><input id="pageVal" name="pageVal" value="Qt 4.7.0: Deploying an Application on the Symbian Platform" style="display: none;"></form>
  </div>
  <div id="blurpage">
  </div>
  <script src="deployment-symbian_files/functions.js" type="text/javascript"></script>
  <!-- <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script> -->
<div style="position: absolute; display: none; z-index: 9999;" id="livemargins_control"><img src="deployment-symbian_files/monitor-background-horizontal.png" style="position: absolute; left: -77px; top: -5px;" width="77" height="5">	<img src="deployment-symbian_files/monitor-background-vertical.png" style="position: absolute; left: 0pt; top: -5px;">	<img id="monitor-play-button" src="deployment-symbian_files/monitor-play-button.png" onmouseover="this.style.opacity=1" onmouseout="this.style.opacity=0.5" style="position: absolute; left: 1px; top: 0pt; opacity: 0.5; cursor: pointer;"></div></body></html>